
function selectitem(num){
	//alert(num);
	var content=document.getElementById("itemcontent");
	var temp="<table>";
	var tempanswer="";
	var arr=new Array("A","B","C","D","E","F","G","H","I","J","K","L");
	for(var i=0;i<num;i=i+1){
		temp+="<tr><td>"+arr[i]+"：</td>";
		tempanswer+='<input type="radio" name="question.answer" value="'+arr[i]+'"/>'+arr[i];
		temp+='<td><input type="text" name="items['+i+'].options" size="70" maxlength="200"/></td></tr>';
	}
	temp+="</table>";
	content.innerHTML=temp;
	var answercontent=document.getElementById("answercontent");
	answercontent.innerHTML=tempanswer;
}

function selecttype(type){
	var questioninfo=document.getElementById("questioninfo");
	var tempinfo="";
	if(type=="SingleChoice"||type=="MultiChoice"){
		tempinfo+='<table width="100%">';
		tempinfo+='<tr><td width="7%" align="right">选项</td>';	
		tempinfo+='<td width="93%"><select name="numitem" onchange="selectitem(this.value)">';
		tempinfo+='<option value="2">2</option>';
		tempinfo+='<option value="3">3</option>';
		tempinfo+='<option value="4" selected="selected">4</option>';
		tempinfo+='<option value="5">5</option>';
		tempinfo+='<option value="6">6</option>';
		tempinfo+='<option value="7">7</option>';
		tempinfo+='<option value="8">8</option>';
		tempinfo+='<option value="9">9</option>';
		tempinfo+='<option value="10">10</option>';
		tempinfo+='<option value="11">11</option>';
		tempinfo+='<option value="12">12</option></select>';
		tempinfo+='<font color="#FF0000">* 请选择选项数目 </font></td>';
		tempinfo+='</tr><tr><td></td><td>';
		tempinfo+='<div id="itemcontent">'
		tempinfo+='<table><tr><td>A：</td>';
		tempinfo+='<td><s:textfield name="points[0]" size="70" maxlength="200"/></td>';
		tempinfo+='</tr><tr><td>B：</td>';
		tempinfo+='<td><input type="text" name="points[1]" size="70" maxlength="200"/></td>';
		tempinfo+='</tr><tr><td>C：</td>';
		tempinfo+='<td><input type="text" name="points[2]" size="70" maxlength="200"/></td>';
		tempinfo+='</tr><tr><td>D：</td>';
		tempinfo+='<td><input type="text" name="points[3]" size="70" maxlength="200"/></td>';
		tempinfo+='</tr></table></div></td></tr>';
		tempinfo+='<tr><td align="right">答案</td>';
		tempinfo+='<td><div id="answercontent"></div></td></tr></table>';
		questioninfo.innerHTML=tempinfo;
	}
	else if(type=="FillIn"){
		
	}
	else if(type=="Document"){
		
	}
	else if(type=="ShortAnswer"||type=="Glossary"||type=="Essay"||type=="Program"){
		
	}
	else if(type=="Judgment"){
		tempinfo='<table width="100%">';
		tempinfo+='<tr><td width="7%" align="right">答案</td><td width="93%">';
		tempinfo+='<input type="radio" name="answer" value="错误 ">错误 ';
		tempinfo+='<input type="radio" name="answer" value="正确 ">正确 </td></tr></table>';
		questioninfo.innerHTML=tempinfo;
	}
}